package com.yu.alimsg;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Slf4j
@Configuration
@EnableConfigurationProperties(AliProperties.class)
public class AliMsgAutoConfig {
    @Bean
    public MsgUtils createMsgUtils (AliProperties aliProperties){
        log.info("初始化阿里短信发送工具类");
        return new MsgUtils(aliProperties.getAccessKeyId(),aliProperties.getAccessKeySecret(),
                aliProperties.getSmsCode(),aliProperties.getSignName());
    }
}
